package org.redis.cluster.config;

import java.io.Serializable;

public class RegistryConfig implements Serializable {
	
	private String registry;
	private String host;
	private Integer port;
	private Integer timeout;
	private String root;
	
	public RegistryConfig() {
		
	}

	public String getRegistry() {
		return registry;
	}

	public void setRegistry(String registry) {
		this.registry = registry;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public Integer getTimeout() {
		return timeout;
	}

	public void setTimeout(Integer timeout) {
		this.timeout = timeout;
	}

	public String getRoot() {
		return root;
	}

	public void setRoot(String root) {
		this.root = root;
	}
	
	@Override
	public int hashCode() {
		return toString().hashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		return obj.toString().equals(toString());
	}

	@Override
	public String toString() {
		return String.format("{host:%s,port:%s,timeout:%s,root:%s}", 
				getHost(),getPort(),getTimeout(),getRoot());
	}
}